package com.gxa.controller;

import com.gxa.common.JsonResult;
import com.gxa.common.R;
import com.gxa.pojo.Goods;
import com.gxa.pojo.Purchase;
import com.gxa.pojo.Store_House;
import com.gxa.pojo.Supply;
import com.gxa.service.LsFinanceService;
import com.gxa.service.PurchaseSellStockService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * @Author: wangyifan
 * @Date: 2021/12/02 9:51
 * @Description: $end$
 * @Version: V1.0
 */
@Controller
@Api(value = "商品进销存数据",tags = "商品进销存数据接口(王议帆)")
@RequestMapping(value = "/purSelStock")
public class PurchaseSellStockController {
    @Autowired
    private PurchaseSellStockService pssService;
    @Autowired
    private LsFinanceService lsFinanceService;

    @RequestMapping(value = "/queryGoods",method = RequestMethod.POST)
    @ApiOperation(value = "商品查询接口",notes = "当前页码数和每页显示条数",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true)
    })
    @ResponseBody
    /**1查询商品*/
    public R queryGoods(@RequestParam(name = "currentPage",defaultValue = "1")Integer currentPage,@RequestParam(name ="pageSize",defaultValue = "10")Integer pageSize){
        R r =pssService.queryGoods(currentPage,pageSize);

        return r;
    }




    @RequestMapping(value = "/queryGoodsType",method = RequestMethod.POST)
    @ApiOperation(value = "商品种类查询接口",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gt_id",value = "商品id",paramType = "query",dataType = "int",required = false)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /**2查询商品种类*/
    public R queryGoodsType(@RequestParam(name = "gt_id",defaultValue = "0")Integer gt_id){
        R r =pssService.queryGoodsType(gt_id);
        return r;
    }

    @RequestMapping(value = "/addGoodsTypeGt_pno",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品种类大类接口",notes = "新增大类名称",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gt_name",value = "新增大类名称",paramType = "query",dataType = "String",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /**3新增商品种类大类*/
    public R addGoodsTypeGt_pno(@RequestParam(name = "gt_name")String gt_name){
        R r =pssService.addGoodsTypeGt_pno(gt_name);
        return r;
    }

    @RequestMapping(value = "/addGoodsTypeGt_name",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品种类小类接口",notes = "大类名称及新增小类名称",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gt_pno",value = "新增大类名称",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "gt_name",value = "新增小类名称",paramType = "query",dataType = "String",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 4新增商品种类小类*/
    public R addGoodsTypeGt_name(@RequestParam(name = "gt_pno")String gt_pno,@RequestParam(name = "gt_name")String gt_name){
        R r =pssService.addGoodsTypeGt_name(gt_pno,gt_name);
        return r;
    }

    @RequestMapping(value = "/updateGoodsTypeGt_pno",method = RequestMethod.POST)
    @ApiOperation(value = "修改商品种类大类接口",notes = "商品种类id及商品种类名称",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gt_id",value = "商品种类id",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "gt_name",value = "商品种类名称",paramType = "query",dataType = "String",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 5修改商品种类大类*/
    public R updateGoodsTypeGt_pno(@RequestParam(name = "gt_id")Integer gt_id,@RequestParam(name = "gt_name") String gt_name){
        R r =pssService.updateGoodsTypeGt_pno(gt_id,gt_name);
        return r;
    }

    @RequestMapping(value = "/updateGoodsTypeGt_name",method = RequestMethod.POST)
    @ApiOperation(value = "修改商品种类小类接口",notes = "商品种类id及商品种类大类名，商品种类小类名",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gt_id",value = "商品种类id",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "gt_pno",value = "商品种类大类",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "gt_name",value = "商品种类小类",paramType = "query",dataType = "String",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 6修改商品种类小类*/
    public R updateGoodsTypeGt_name(@RequestParam(name = "gt_id")Integer gt_id,@RequestParam(name = "gt_pno")String gt_pno,@RequestParam(name = "gt_name")String gt_name){
        R r =pssService.updateGoodsTypeGt_name(gt_id,gt_pno,gt_name);
        return r;
    }


    @RequestMapping(value = "/deleteGoodsType",method = RequestMethod.POST)
    @ApiOperation(value = "删除商品种类接口",notes = "商品种类id",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gt_id",value = "商品种类id",paramType = "query",dataType = "int",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 7删除商品种类*/
    public R deleteGoodsType(@RequestParam(name = "gt_id")Integer gt_id){
        R r = pssService.deleteGoodsType(gt_id);
        return r;
    }

    @RequestMapping(value = "/addGoods",method = RequestMethod.POST)
    @ApiOperation(value = "添加商品接口",notes = "商品信息明细map",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 8增加商品*/
    public R addGoods(@RequestBody @ApiParam(name = "goods",value = "商品实体") Goods goods){
        R r = pssService.addGoods(goods);
    return  r;
    }

    @RequestMapping(value = "/updateGoods",method = RequestMethod.POST)
    @ApiOperation(value = "修改商品信息接口",notes = "商品信息修改明细map",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 9修改商品*/
    public R updateGoods(@RequestBody @ApiParam(name = "goods",value ="商品实体" ) Goods goods){
        R r = pssService.updateGoods(goods);
        return  r;
    }

    @RequestMapping(value = "/searchGoods",method = RequestMethod.POST)
    @ApiOperation(value = "搜索商品信息接口",notes = "搜索商品信息",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gt_pno",value = "大类名称",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "gt_name",value = "小类名称",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "goods_name",value = "商品名",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "goods_descript",value = "商品规格",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "goods_barcode",value = "商品型号",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true)
    })
    @ResponseBody
    /** 10搜索商品*/
    public JsonResult searchGoods(@RequestParam(name = "gt_pno",defaultValue = "")String gt_pno,@RequestParam(name = "gt_name",defaultValue = "")String gt_name,@RequestParam(name = "goods_name",defaultValue = "")String goods_name,@RequestParam(name = "goods_descript",defaultValue = "")String goods_descript,
                         @RequestParam(name = "goods_barcode",defaultValue = "")String goods_barcode,@RequestParam(name = "currentPage",defaultValue = "")Integer currentPage,@RequestParam(name = "pageSize")Integer pageSize){
        JsonResult r = pssService.searchGoods(gt_pno,gt_name,goods_name,goods_descript,goods_barcode,currentPage,pageSize);
        return  r;
    }

    @RequestMapping(value = "/deleteGoods",method = RequestMethod.POST)
    @ApiOperation(value = "删除商品信息接口",notes = "删除商品id",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "goods_id",value = "商品id",paramType = "query",dataType = "int",required = true)
    })
    @ResponseBody
    /** 11删除商品*/
    public R deleteGoods(@RequestParam(name = "goods_id") Integer goods_id){

        R r = pssService.deleteGoods(goods_id);
        return  r;
    }

    @RequestMapping(value = "/batchDeleteGoods",method = RequestMethod.POST)
    @ApiOperation(value = "批量删除商品信息接口",notes = "批量删除商品的id",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 12批量删除商品*/
    public R batchDeleteGoods(@RequestBody @ApiParam(name = "goods_idList",value = "商品id的集合") List<Integer> goods_idList){
        R r = pssService .batchDeleteGoods(goods_idList);
        return  r;
    }

    @RequestMapping(value = "/queryPurchase",method = RequestMethod.POST)
    @ApiOperation(value = "查询采购记录接口",notes = "当前页码数和每页显示条数",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 13查询采购记录*/
    public R queryPurchase(@RequestParam(name ="currentPage") Integer currentPage,@RequestParam(name ="pageSize")Integer pageSize){
        R r = pssService.queryPurchase(currentPage,pageSize);
        return r;
    }

    @RequestMapping(value = "/addPurchase",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品采购接口",notes = "采购信息实体",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 14新增商品采购*/
    public R addPurchase(@RequestBody @ApiParam(name = "purchase",value = "供应商信息实体") Purchase purchase){
        R r = pssService.addPurchase(purchase);
        return r;

    }

    @RequestMapping(value = "/deletePurchase",method = RequestMethod.POST)
    @ApiOperation(value = "删除商品采购接口",notes = "采购信息id",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pur_id",value = "采购信息id",paramType = "query",dataType = "int",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 15删除商品采购信息*/
    public R deletePurchase(@RequestParam(name = "pur_id")Integer pur_id){
        R r = pssService.deletePurchase(pur_id);
        return r;
    }

    @RequestMapping(value = "/querySupply",method = RequestMethod.POST)
    @ApiOperation(value = "查询供应商信息接口",notes = "当前页码数和每页显示条数",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "int",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 16查询供应商*/
    public R querySupply(@RequestParam(name ="currentPage",defaultValue = "1") Integer currentPage,@RequestParam(name ="pageSize",defaultValue = "10")Integer pageSize){
        R r = pssService.querySupply(currentPage,pageSize);
        return r;
    }

    @RequestMapping(value = "/addSupply",method = RequestMethod.POST)
    @ApiOperation(value = "增加供应商信息接口",notes = "供应商信息",httpMethod = "post",response = R.class)

    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 17增加供应商*/
    public R addSupply(@RequestBody @ApiParam(name = "supply",value = "供应商信息实体",required = true) Supply supply){
        R r = pssService.addSupply(supply);
        return r;
    }

    @RequestMapping(value = "/searchSupply1",method = RequestMethod.POST)
    @ApiOperation(value = "高级搜索供应商信息接口",notes = "供应商信息",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "su_name",value = "供应商姓名",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_cooperation",value = "合作情况(1已合作2未合作)",paramType = "query",dataType = "int",required = false),
            @ApiImplicitParam(name = "su_contact",value = "联系人",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_phone",value = "电话",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_tel",value = "手机号",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_fax",value = "传真",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_we",value = "微信号",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_qq",value = "QQ",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_email",value = "邮箱",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_web",value = "网址",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_pro",value = "省份",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "su_city",value = "城市",paramType = "query",dataType = "String",required = false),
            @ApiImplicitParam(name = "add_date01",value = "添加日期前",paramType = "query",dataType = "Date",required = false),
            @ApiImplicitParam(name = "add_date02",value = "添加日期后",paramType = "query",dataType = "Date",required = false)
    })
    @ResponseBody
    /** 18高级搜索供应商*/
    public R searchSupply1(
          @RequestParam(name = "su_name",defaultValue = "") String su_name,
          @RequestParam(name = "su_cooperation",defaultValue = "0") Integer su_cooperation,
          @RequestParam(name = "su_contact",defaultValue = "") String su_contact,
          @RequestParam(name = "su_phone",defaultValue = "") String su_phone,
          @RequestParam(name = "su_tel",defaultValue = "") String su_tel,
          @RequestParam(name = "su_fax",defaultValue = "") String su_fax,
          @RequestParam(name = "su_we",defaultValue = "") String su_we,
          @RequestParam(name = "su_qq",defaultValue = "") String su_qq,
          @RequestParam(name = "su_email",defaultValue = "") String su_email,
          @RequestParam(name = "su_web",defaultValue = "") String su_web,
          @RequestParam(name = "su_pro",defaultValue = "") String su_pro,
          @RequestParam(name = "su_city",defaultValue = "") String su_city,
          @DateTimeFormat(pattern = "yyyy-MM-dd") @RequestParam(name = "add_date01",defaultValue = " ")  Date  add_date01,
          @DateTimeFormat(pattern = "yyyy-MM-dd") @RequestParam(name = "add_date02",defaultValue = "") Date   add_date02
    ){
              R r = pssService.searchSupply(su_name,su_cooperation,su_contact,su_phone,su_tel,su_fax,su_we,su_qq,su_email,su_web,su_pro,su_city,add_date01,add_date02);
        return r;
    }

    @RequestMapping(value = "/searchSupply2",method = RequestMethod.POST)
    @ApiOperation(value = "普通搜索供应商信息接口",notes = "供应商信息",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "s",value = "供应商，联系人，手机号",paramType = "query",dataType = "String",required = false)
    })
    @ResponseBody
    /** 19普通搜索供应商*/
    public R searchSupply2(@RequestParam(name = "s",defaultValue = "") String s){
            R r = pssService.searchSupply2(s);
        return r;
    }

    @RequestMapping(value = "/deleteSupply",method = RequestMethod.POST)
    @ApiOperation(value = "删除供应商信息接口",notes = "供应商信息",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "su_id",value = "供应商id",paramType = "query",dataType = "int",required = true)
    })
    @ResponseBody
    /** 20删除供应商*/
    public R deleteSupply(@RequestParam(name = "su_id") Integer su_id){
        R r = pssService.deleteSupply(su_id);
        return r;
    }

    @RequestMapping(value = "/updateSupply",method = RequestMethod.POST)
    @ApiOperation(value = "修改供应商信息接口",notes = "供应商信息",httpMethod = "post",response = R.class)

    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /**21修改供应商*/
    public R updateSupply(@RequestBody @ApiParam(name = "supply",value = "供应商信息实体",required = true) Supply supply){
        R r = pssService.updateSupply(supply);
        return r;
    }

    @RequestMapping(value = "/queryStoreHouse",method = RequestMethod.POST)
    @ApiOperation(value = "查询仓库信息接口",notes = "当前页码数和每页显示条数",httpMethod = "post",response = R.class)
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 22查询仓库*/
    public R queryStoreHouse(){
        R r = pssService.queryStoreHouse();
        return r;
    }

    @RequestMapping(value = "/addStoreHouse",method = RequestMethod.POST)
    @ApiOperation(value = "增加仓库信息接口",notes = "仓库信息",httpMethod = "post",response = R.class)

    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 23增加仓库*/
    public R addStoreHouse(@RequestBody @ApiParam(name = "storeHouse",value = "仓库信息实体",required = true) Store_House storeHouse){
        R r = pssService.addStoreHouse(storeHouse);
        return r;
    }

    @RequestMapping(value = "/updateStoreHouse",method = RequestMethod.POST)
    @ApiOperation(value = "修改仓库信息接口",notes = "仓库信息",httpMethod = "post",response = R.class)

    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 24修改仓库*/
    public R updateStoreHouse(@RequestBody @ApiParam(name = "storeHouse",value = "仓库信息实体",required = true) Store_House storeHouse){
        R r = pssService.updateStoreHouse(storeHouse);
        return r;
    }

    @RequestMapping(value = "/deleteStoreHouse",method = RequestMethod.POST)
    @ApiOperation(value = "删除仓库信息接口",notes = "仓库信息",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sh_id",value = "仓库id",paramType = "query",dataType = "int",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 25删除仓库*/
    public R deleteStoreHouse( @RequestParam(name = "sh_id") Integer sh_id){
        R r = pssService.deleteStoreHouse(sh_id);
        return r;
    }

    @RequestMapping(value = "/querySalesRecord",method = RequestMethod.POST)
    @ApiOperation(value = "查询销售记录接口",notes = "当前页码数和每页显示条数",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示条数",paramType = "query",dataType = "String",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功"),
            @ApiResponse(code = 404,message = "找不到页面"),
            @ApiResponse(code = 500,message = "后台服务错误")
    })
    @ResponseBody
    /** 26查询销售记录*/
    public R querySalesRecord(@RequestParam(name ="currentPage") Integer currentPage,@RequestParam(name ="pageSize")Integer pageSize){
        R r = pssService.querySalesRecord(currentPage,pageSize);
        return r;
    }

    @RequestMapping(value = "/queryPayment",method = RequestMethod.POST)
    @ApiOperation(value = "查询支付方式接口",httpMethod = "post",response = R.class)
    @ResponseBody
    /** 27查询支付方式*/
    public R queryPayment(){
        R r = pssService.queryPayment();
        return r;
    }

    @RequestMapping(value = "/countDataBase",method = RequestMethod.POST)
    @ApiOperation(value = "查询总条数接口",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "database",value = "数据表名",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    /** 28获取总条数接口*/
    public JsonResult countDataBase(@RequestParam(name = "database") String database){
        JsonResult jsonResult = pssService.countDataBase(database);
        return jsonResult;
    }



}
